{if $counter==1}
    {assign var=bgClass value='bgLight'}
{else}
    {assign var=bgClass value='bgDark'}
{/if}

<tr class="{$bgClass} inlineFormShow row" id="row_{$record.recordId}" onclick="selectRow('{$record.recordId}','{$bgClass}')">
    {if isset($smarty.request.editRecord) && $smarty.request.editRecord==$record.recordId && $type=='full'}
        <td>
            <input style="width: 100px" name="record[date]" id="rdate_edit" type="text" value="{$record.date_formated}" onchange="unexpended($('#rdate_edit').val(), $('#rclient_edit').val());" />
        </td>
        <td>
            <select style="width: 120px" name="record[client]" id="rclient_edit" size="1" onchange="unexpended($('#rdate_edit').val(), $('#rclient_edit').val());" >
                <option value="-1">Please select</option>
                {foreach $data.clients as $key => $client}
                    <option {if $smarty.session.user.user_type_id!=$smarty.const.USER_TYPE_CLIENT && $client.bad_payer==1}class="badPayer"{/if} {if $record.client==$client.klient_id}selected="selected"{/if} value="{$client.klient_id}">{$client.name}</option>
                {/foreach}
            </select>
        </td>
        <td>
            <select style="width: 150px" name="record[type]" id="rtype_edit" size="1" onchange="changeTariffs(this.value,'rtariff_edit')">
                <option value="-1">Please select</option>
                {foreach $data.rtypes as $key => $type}
                    <option {if $type.Id==$record.type}selected="selected"{/if} value="{$type.Id}">{$type.type_of_record}</option>
                {/foreach}
            </select>
        </td>
        <td>
            <input style="width: 80px" name="record[amount]" id="ramount_edit" class="float" type="text" value="{$record.amount}"  />
            {if $record.tariff == 6}
                <input id="ramount_original_edit" type="hidden" value="{$record.amount}"  />
            {else}
                <input id="ramount_original_edit" type="hidden" value="0"  />
            {/if}
        </td>
        <td>
            <select style="width: 120px" name="record[tariff]" id="rtariff_edit" size="1" onchange="fillPrice(this.value,'rprice_edit'); fillDescription('#rdescription_edit', this.value);changeOriginalAmount(this.value,'{$record.amount}')">
                <option value="-1">Please select</option>
                {foreach $data.rtariffs_edit as $key => $tariff}
                    <option {if $tariff.Id==$record.tariff}selected="selected"{/if} value="{$tariff.Id}">{$tariff.title}</option>
                {/foreach}
            </select>
        </td>
        <td>
            <input style="width: 200px" name="record[description]"  maxlength="512" id="rdescription_edit" type="text" value="{$record.description}"/>
        </td>
        <td>
            <input style="width: 80px" name="record[price]" id="rprice_edit" class="double" type="text" value="{$record.unit_price}" />
        </td>
        <td>
            <select style="width: 120px" name="record[user_id]" id="ruser_id_edit" size="1" {*onchange="showReport(this.value)"*}>
                {foreach $data.rusers as $key => $user}
                    <option {if $record.user_id==$user.users_id}selected="selected"{/if} value="{$user.users_id}">{$user.name} {$user.surname}</option>
                {/foreach}
            </select>
        </td>
        <td style="width: 50px" >
            <input name="recordId" value="{$record.recordId}" type="hidden" />
            <input name="action" value="edit_record" type="hidden" />
            <input type="submit" value="Save" name="add_record" />
        </td>
        <td style="width: 50px" ></td>
    {else}
        <td>{$record.date_formated}</td>
        <td>{$record.client_info.name}</td>
        <td>{$record.type_info.type_of_record}</td>
        <td>{$record.amount}</td>
        <td>
            {if $record.tariff==-1}
                -
            {else}
                {$record.tariff_info.title}
            {/if}
        </td>
        <td>
            {if $type=='full'}
                {if $record.locked==0}
                    <a class="baseLink" href="{$data.root}?input=edit_task&task={$record.taskId}&editRecord={$record.recordId}">{$record.description}</a>
                {else}
                    {$record.description}
                    <img height="16" title="locked" width="16" src="{$smarty.const.PATH_TO_IMAGES}locked.png" />
                {/if}
            {else}
                {$record.description}
            {/if}
        </td>
        <td>{$record.unit_price}</td>
        <td>{$record.user_info.name} {$record.user_info.surname}</td>
        <td style="width: 50px" >
            {if $type=='full'}
                <a href="{$data.root}?input=edit_task&amp;task={$record.taskId}&amp;copy_id={$record.recordId}">
                    <img height="16" width="16" src="{$smarty.const.PATH_TO_IMAGES}copy.png" />
                </a> 
            {/if}
        </td>
        <td style="width: 50px" >
            {if $smarty.session.user.user_type_id == $smarty.const.USER_TYPE_ADMIN && $record.attention==1}
                <a href="{$data.root}?input=tsdr_more&amp;tsdr_id={$record.recordId}" target="_blank">
                    <img height="16" width="16" src="{$smarty.const.PATH_TO_IMAGES}more-red.png" />
                </a>
            {else}
                <a href="{$data.root}?input=tsdr_more&amp;tsdr_id={$record.recordId}" target="_blank">
                    <img height="16" width="16" src="{$smarty.const.PATH_TO_IMAGES}more.png" />
                </a>
            {/if}
        </td>
    {/if}
</tr>